from typing import List


# Definition for a Node.
class Node:
    def __init__(self, val=None, children=None):
        self.val = val
        self.children = children if children is not None else []


class Solution:
    def findRoot(self, tree: List['Node']) -> 'Node':
        maybe = set(tree)
        for n1 in tree:
            for n2 in n1.children:
                maybe.remove(n2)
        return maybe.pop()


if __name__ == "__main__":
    pass
